<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Carrier TakeOrder</title>
    <link rel="stylesheet" href="../../static/css/common.css">
    <link rel="stylesheet" href="../../static/css/form.css">
    <link rel="stylesheet" href="../../static/css/order.css">
    <link rel="stylesheet" type="text/css" href="../../static/layui/css/layui.css"/>
    <script type="text/javascript" src="../../static/layui/layui.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- 菜单栏 -->
<link rel="stylesheet" href="../../static/css/index.css">
<ul>
    <div th:each="item:${menuList}" class="display:inline-de">
        <li><a th:href="@{${item.path}}" th:text="${item.name}"></a></li>
    </div>
    <a th:href="@{/login}" style="float:right;font-size: 16px;margin: 17px;color: white;">> 登出</a>
</ul>
<from lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>take order</title>
    </head>
    <body>
    <input type="hidden" name="_method" value="delete">
    <div class="box">
        <div class="form-group">
            <table class="table table-bordered box-table">
                <tr>
                    <th style="width: 70px;">编号</th>
                    <th style="width: 230px;">创建时间</th>
                    <th style="width: 80px;">起始点</th>
                    <th style="width: 80px;">目的地</th>
                    <th style="width: 80px;">收货人</th>
                    <th style="width: 100px;">描述</th>
                    <th style="width: 150px;">货物</th>
                    <th style="width: 100px;">重量(t)</th>
                    <th style="width: 80px;">操作</th>
                </tr>
                <tr th:each="s : ${shippingOrderList}">
                    <td th:text="${s.id}"></td>
                    <td th:text="${s.time}"></td>
                    <td th:text="${s.start}"></td>
                    <td th:text="${s.target}"></td>
                    <td th:text="${s.consignee}"></td>
                    <td th:text="${s.desc}"></td>
                    <td th:text="${s.goods}"></td>
                    <td th:text="${s.weight}"></td>
                    <td>
                        <div class="layui-btn-container">
                            <button class="layui-btn" th:onclick="|operate(${carrierId},${userId},${s.id})|">接单</button>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
    </body>
</from>
<script>
    function operate(carrierId,operator,id){
        let data = {
            carrierId : carrierId,
            operator : operator,
            orderId : id,

        }
        console.log(data)
        $.ajax({
            type: "post",
            url: "/carrier/carrierOperate",
            data: data,
            complete:function(){
                console.log('你输出吗')
                location.reload();
            }
        });
    }
</script>
</body>
</html>
